<extend name="Base/common"/>

<block name="body">
<style type="text/css">
.form-create {
  max-width: 330px;
  padding: 15px;
  margin: 0 auto;
}
.form-project a:hover{
  TEXT-DECORATION:none;
}
</style>
<title>项目协作 - {:C('SITE_TITLE')}</title>
<div class="container"><!--container-->
<div class="row"><!--row-->
	<div class="col-md-9">
  <volist name="creater" id="vo">
      <div class="col-md-3 form-project">
      <a href="/Home/Project/{$vo['id']}" target="_BLANK"><div class="well well-lg">
        <div style="height:80px;"><h4>{$vo['name']}<br /><small>项目ID：{$vo['id']}</small></h4></div>
        <p><span class="glyphicon glyphicon-user"></span> 创始人</p>
      </div></a></div>
  </volist>
  <volist name="member" id="vo">
      <div class="col-md-3 form-project">
      <a href="/Home/Project/{$vo['pid']}" target="_BLANK"><div class="well well-lg">
        <div style="height:80px;"><h4>{:getProjectname($vo['pid'])}<br /><small>项目ID：{$vo['pid']}</small></h4></div>
        <p><span class="glyphicon glyphicon-user"></span> {$vo['admin']?'管理员':'会员'}</p>
      </div></a></div>
  </volist>
  </div><!--/col-md-8-->
	<div class="col-md-3" id="space_height">
<script type="text/javascript">
  function go_pid(){
    window.location.href="/Home/Project/"+$("#go_pid").val();
  }
</script>
    <div class="input-group">
      <input type="text" class="form-control" id="go_pid" placeholder="输入项目ID以进入项目页">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button" onclick="go_pid()">Go!</button>
      </span>
    </div><!-- /input-group -->
<hr>

<!--项目列表-->
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">我的项目</h3>
  </div>
  <div class="panel-body">
<ul class="nav nav-pills nav-stacked" role="tablist">
  <li role="presentation" id="project_index_all"><a href="{:U('/Home/Project.html/all/')}">所有</a></li>
  <li role="presentation" id="project_index_creater"><a href="{:U('/Home/Project.html/creater/')}">我所创建的</a></li>
  <li role="presentation" id="project_index_admin"><a href="{:U('/Home/Project.html/admin/')}">我是管理的</a></li>
  <li role="presentation" id="project_index_member"><a href="{:U('/Home/Project.html/member/')}">我是成员的</a></li>
</ul>
<hr>

<!-- Modal -->
<div class="modal fade" id="create" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">取消</span></button>
        <h4 class="modal-title" id="myModalLabel">创建项目</h4>
      </div>
      <div class="modal-body">
      <form method="post" action="{:'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']}">
      	<input type="hidden" name="type" value="create">
        <input class="form-control" style="width:300px;" type="text" name="name" class="form-control" placeholder="项目名称" required>
        <br />
        <textarea id="content" class="form-control" rows="3" name="content" placeholder="请填写一些关于本项目的介绍（可选）"></textarea>
        <br />
        <div>
        <label class="col-sm-2 control-label">公开性：</label>
        <label>
    	<input type="radio" name="allow_join" id="optionsRadios1" value="1" checked>
    	所有人可见
  		</label>
  		<label>
    	<input type="radio" name="allow_join" id="optionsRadios2" value="0">
    	只限组员可见
  		</label>
  		</div>
  		<input class="form-control" style="width:300px;" type="text" name="lang" class="form-control" placeholder="项目语言" required>
  		<h5>多种语言请以英文逗号隔开：","</h5>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="submit" class="btn btn-primary">提交</button>
      </div>
     </form>
    </div>
  </div>
</div>

<center><button class="btn btn-primary" data-toggle="modal" data-target="#create">创建一个项目</button></center>

  </div>
</div>
<!--/项目列表-->
	</div>
</div><!--/container-->
</div><!--/row-->

<script type="text/javascript">
  document.getElementById("project").className="active";
  document.getElementById("{$project_index_active}").className="active";
</script>

</block>